package com.myproject.filmrecommendationsys.domain;

import java.util.Date;
import lombok.Data;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.Size;

/**
 * 用户对象 user
 */
@Data
public class User
{
    private static final long serialVersionUID = 1L;
    private Long id;
    @NotBlank(message = "用户名不能为空")
    @Size(max = 20,min= 1, message = "用户名长度在1-20之间")
    private String username;
    private String password;
    private String email;
    private String avatar;
    private Date createdTime;
    private Date updatedTime;

    public User(Long id, String username, String password, String email, String avatar, Date createdTime, Date updatedTime) {
        this.id = id;
        this.username = username;
        this.password = password;
        this.email = email;
        this.avatar = avatar;
        this.createdTime = createdTime;
        this.updatedTime = updatedTime;
    }
    public User(){}

    @Override
    public String toString() {
        return "User{" +
                "id=" + id +
                ", username='" + username + '\'' +
                ", password='" + password + '\'' +
                ", email='" + email + '\'' +
                ", avatar='" + avatar + '\'' +
                ", createdTime=" + createdTime +
                ", updatedTime=" + updatedTime +
                '}';
    }
}
